/*
 * BaseManager.h
 *
 *  Created on: 2013-8-29
 *      Author: wh
 */

#ifndef BASEMANAGER_H_
#define BASEMANAGER_H_

#include "../kaka/kaka.h"
#include "Constants.h"

typedef void (CCObject::*SEL_ModelSelector)(CCObject*, void*);
#define model_selector(_SELECTOR) (SEL_ModelSelector)(&_SELECTOR)

class BaseManager {
private:

	CCObject* _pTarget;
	SEL_ModelSelector _pModelSelector;

protected:

	void setManagerCallBack(CCObject* pTarget, SEL_ModelSelector pSelector);

	void handleManagerCallBack(CCObject* obj, void* args);

public:
	BaseManager();

	virtual ~BaseManager();

	template<class T> static T* sharedController() {
		static T t;
		//t.init();
		return &t;
	}
	;

};

#endif /* BASEMANAGER_H_ */
